#
# Be sure to run `pod lib lint MirrorRealm.podspec' to ensure this is a
# valid spec before submitting.
#
# Any lines starting with a # are optional, but their use is encouraged
# To learn more about a Podspec see https://guides.cocoapods.org/syntax/podspec.html
#

Pod::Spec.new do |s|
  s.name             = 'MirrorRealm'
  s.version          = '0.1.0'
  s.summary          = 'MirrorRealm can export the Realm to swift as a framework module.'

# This description is used to generate tags and improve search results.
#   * Think: What does it do? Why did you write it? What is the focus?
#   * Try to keep it short, snappy and to the point.
#   * Write the description between the DESC delimiters below.
#   * Finally, don't worry about the indent, CocoaPods strips it!

  s.description      = <<-DESC
TODO: MirrorRealm can export the Realm to swift as a framework module.
                       DESC

  s.homepage         = 'https://gitee.com/tjerwinchen/mirror-realm'
  # s.screenshots     = 'www.example.com/screenshots_1', 'www.example.com/screenshots_2'
  s.license          = { :type => 'MIT', :file => 'LICENSE' }
  s.author           = { 'Theo Chen' => 'me@theochen.com' }
  s.source           = { :git => 'https://gitee.com/tjerwinchen/mirror-realm.git', :tag => 'Realm-' + s.version.to_s }
  s.social_media_url = 'https://twitter.com/realm'

  s.ios.deployment_target = '10.0'

  s.cocoapods_version = '>= 1.8.0'
  s.static_framework = false
  s.prefix_header_file = false

  s.source_files = [
    "Mirror/Realm/*.{m,h}",
    "Mirror/Realm/Realm/*.{m,mm}",
    "Mirror/Realm/Realm/ObjectStore/src/*.cpp",
    "Mirror/Realm/Realm/ObjectStore/src/sync/*.cpp",
    "Mirror/Realm/Realm/ObjectStore/src/sync/impl/*.cpp",
    "Mirror/Realm/Realm/ObjectStore/src/sync/impl/apple/*.cpp",
    "Mirror/Realm/Realm/ObjectStore/src/impl/*.cpp",
    "Mirror/Realm/Realm/ObjectStore/src/impl/apple/*.cpp",
    "Mirror/Realm/Realm/ObjectStore/src/util/*.cpp",
    "Mirror/Realm/Realm/ObjectStore/src/util/apple/*.cpp",
    "Mirror/Realm/include/**/RLMAccessor.h",
    "Mirror/Realm/include/**/RLMArray_Private.h",
    "Mirror/Realm/include/**/RLMCollection_Private.h",
    "Mirror/Realm/include/**/RLMListBase.h",
    "Mirror/Realm/include/**/RLMObjectBase_Private.h",
    "Mirror/Realm/include/**/RLMObjectSchema_Private.h",
    "Mirror/Realm/include/**/RLMObjectStore.h",
    "Mirror/Realm/include/**/RLMObject_Private.h",
    "Mirror/Realm/include/**/RLMOptionalBase.h",
    "Mirror/Realm/include/**/RLMProperty_Private.h",
    "Mirror/Realm/include/**/RLMRealmConfiguration_Private.h",
    "Mirror/Realm/include/**/RLMRealm_Private.h",
    "Mirror/Realm/include/**/RLMResults_Private.h",
    "Mirror/Realm/include/**/RLMSchema_Private.h",
    "Mirror/Realm/include/**/RLMSyncConfiguration_Private.h",
    "Mirror/Realm/include/**/RLMSyncUtil_Private.h",
  ]

  s.private_header_files = [
    "Mirror/Realm/include/**/RLMAccessor.h",
    "Mirror/Realm/include/**/RLMArray_Private.h",
    "Mirror/Realm/include/**/RLMCollection_Private.h",
    "Mirror/Realm/include/**/RLMListBase.h",
    "Mirror/Realm/include/**/RLMObjectBase_Private.h",
    "Mirror/Realm/include/**/RLMObjectSchema_Private.h",
    "Mirror/Realm/include/**/RLMObjectStore.h",
    "Mirror/Realm/include/**/RLMObject_Private.h",
    "Mirror/Realm/include/**/RLMOptionalBase.h",
    "Mirror/Realm/include/**/RLMProperty_Private.h",
    "Mirror/Realm/include/**/RLMRealmConfiguration_Private.h",
    "Mirror/Realm/include/**/RLMRealm_Private.h",
    "Mirror/Realm/include/**/RLMResults_Private.h",
    "Mirror/Realm/include/**/RLMSchema_Private.h",
    "Mirror/Realm/include/**/RLMSyncConfiguration_Private.h",
    "Mirror/Realm/include/**/RLMSyncUtil_Private.h",
  ]

  # s.public_header_files = [
  #   'Mirror/Realm/include/**/*.hpp',
  # ]

  s.preserve_paths = [
    "Mirror/Realm/README.md",
    "Mirror/Realm/CHANGELOG.md",
    "Mirror/Realm/build.sh",
    "Mirror/Realm/include"
  ]

  s.header_mappings_dir = "Mirror/Realm/include"
  s.pod_target_xcconfig = {
    "APPLICATION_EXTENSION_API_ONLY" => "YES",
    "CLANG_CXX_LANGUAGE_STANDARD" => "c++14",
    "CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF" => "NO",
    "OTHER_CPLUSPLUSFLAGS" => "-isystem \"${PODS_ROOT}/MirrorRealm/Mirror/Realm/include/core\" -fvisibility-inlines-hidden",
    #"OTHER_CPLUSPLUSFLAGS" => "-isystem \"${PODS_ROOT}/../../Mirror/Realm/include/core\" -fvisibility-inlines-hidden",
    "USER_HEADER_SEARCH_PATHS" => "\"${PODS_ROOT}/MirrorRealm/Mirror/Realm/include\" \"${PODS_ROOT}/MirrorRealm/Mirror/Realm/include/Realm\""
    #"USER_HEADER_SEARCH_PATHS" => "\"${PODS_ROOT}/../../Mirror/Realm/include\" \"${PODS_ROOT}/../../Mirror/Realm/include/Realm\""

  }

  s.frameworks = 'Security'
  s.module_map = "Mirror/Realm/Realm/MirrorRealm.modulemap"
  s.compiler_flags = "-DREALM_HAVE_CONFIG -DREALM_COCOA_VERSION='@\"#{s.version.to_s}\"' -D__ASSERTMACROS__ -DREALM_ENABLE_SYNC"
  s.ios.vendored_libraries = 'Mirror/Realm/core/librealmcore-ios.a'
  s.watchos.vendored_libraries = 'Mirror/Realm/core/librealmcore-watchos.a'

  s.libraries  = 'z', 'c++'
   # s.resource_bundles = {
   #   'MirrorRealm' => ['Mirror/Realm/Assets/*.bundle']
   # }
  
  s.subspec  'Headers' do |ss|
    ss.source_files = [
      "Mirror/Realm/include/**/RLMArray.h",
      "Mirror/Realm/include/**/RLMCollection.h",
      "Mirror/Realm/include/**/RLMConstants.h",
      "Mirror/Realm/include/**/RLMListBase.h",
      "Mirror/Realm/include/**/RLMMigration.h",
      "Mirror/Realm/include/**/RLMObject.h",
      "Mirror/Realm/include/**/RLMObjectBase.h",
      "Mirror/Realm/include/**/RLMObjectSchema.h",
      "Mirror/Realm/include/**/RLMOptionalBase.h",
      "Mirror/Realm/include/**/RLMPlatform.h",
      "Mirror/Realm/include/**/RLMProperty.h",
      "Mirror/Realm/include/**/RLMRealm.h",
      "Mirror/Realm/include/**/RLMRealm+Sync.h",
      "Mirror/Realm/include/**/RLMRealmConfiguration+Sync.h",
      "Mirror/Realm/include/**/RLMRealmConfiguration.h",
      "Mirror/Realm/include/**/RLMResults.h",
      "Mirror/Realm/include/**/RLMSchema.h",
      "Mirror/Realm/include/**/RLMSyncConfiguration.h",
      "Mirror/Realm/include/**/RLMSyncCredentials.h",
      "Mirror/Realm/include/**/RLMSyncManager.h",
      "Mirror/Realm/include/**/RLMSyncPermission.h",
      "Mirror/Realm/include/**/RLMSyncSession.h",
      "Mirror/Realm/include/**/RLMSyncSubscription.h",
      "Mirror/Realm/include/**/RLMSyncUser.h",
      "Mirror/Realm/include/**/RLMSyncUtil.h",
      "Mirror/Realm/include/**/RLMThreadSafeReference.h",
      "Mirror/Realm/include/**/NSError+RLMSync.h",
      "Mirror/Realm/include/**/MirrorRealm.h",
      "Mirror/Realm/include/**/RLMRealm_Dynamic.h",
      "Mirror/Realm/include/**/RLMObjectBase_Dynamic.h"
    ]
    ss.public_header_files = [
      "Mirror/Realm/include/**/RLMArray.h",
      "Mirror/Realm/include/**/RLMCollection.h",
      "Mirror/Realm/include/**/RLMConstants.h",
      "Mirror/Realm/include/**/RLMListBase.h",
      "Mirror/Realm/include/**/RLMMigration.h",
      "Mirror/Realm/include/**/RLMObject.h",
      "Mirror/Realm/include/**/RLMObjectBase.h",
      "Mirror/Realm/include/**/RLMObjectSchema.h",
      "Mirror/Realm/include/**/RLMOptionalBase.h",
      "Mirror/Realm/include/**/RLMPlatform.h",
      "Mirror/Realm/include/**/RLMProperty.h",
      "Mirror/Realm/include/**/RLMRealm.h",
      "Mirror/Realm/include/**/RLMRealm+Sync.h",
      "Mirror/Realm/include/**/RLMRealmConfiguration+Sync.h",
      "Mirror/Realm/include/**/RLMRealmConfiguration.h",
      "Mirror/Realm/include/**/RLMResults.h",
      "Mirror/Realm/include/**/RLMSchema.h",
      "Mirror/Realm/include/**/RLMSyncConfiguration.h",
      "Mirror/Realm/include/**/RLMSyncCredentials.h",
      "Mirror/Realm/include/**/RLMSyncManager.h",
      "Mirror/Realm/include/**/RLMSyncPermission.h",
      "Mirror/Realm/include/**/RLMSyncSession.h",
      "Mirror/Realm/include/**/RLMSyncSubscription.h",
      "Mirror/Realm/include/**/RLMSyncUser.h",
      "Mirror/Realm/include/**/RLMSyncUtil.h",
      "Mirror/Realm/include/**/RLMThreadSafeReference.h",
      "Mirror/Realm/include/**/NSError+RLMSync.h",
      "Mirror/Realm/include/**/MirrorRealm.h",
      "Mirror/Realm/include/**/RLMRealm_Dynamic.h",
      "Mirror/Realm/include/**/RLMObjectBase_Dynamic.h"
    ]
  end


  
end
